﻿using IRepository;
using IServices;
using SqlSugar;
using System;
using System.Collections.Generic;
using YL.Core.Entity;
using YL.Utils.Extensions;
using YL.Utils.Json;
using YL.Utils.Pub;
using YL.Utils.Table;

namespace Services
{
    public class Whr_studentServices : BaseServices<Whr_student>, IWhr_studentServices
    {
        private readonly SqlSugarClient _client;
        private readonly IWhr_studentRepository _repository;

        public Whr_studentServices(SqlSugarClient client, IWhr_studentRepository repository) : base(repository)
        {
            _client = client;
            _repository = repository;
        }

        public (int, List<Whr_student>) PageList(int userId, Bootstrap.BootstrapParams bootstrap)
        {
            var totalNumber = 0;
            var list = _client.Queryable<Whr_student>().Where(s => s.UserId == userId).ToPageList(bootstrap.offset, bootstrap.limit, ref totalNumber);
            return (totalNumber, list);
        }
    }
}
